// 该文件专门用于暴露一个store对象，一个应用只有一个store对象

// 引入createStore，专门用于创建redux中最核心的store对象
import {createStore,applyMiddleware} from 'redux'
// 用于混合reducer
import {combineReducers} from "redux";

// 引入thunk，用于支持异步action
import {thunk} from 'redux-thunk'

import {composeWithDevTools} from "redux-devtools-extension";

// 引入专门为Count组件服务的reducer
import countReducer from './reducers/count'
// 引入专门为Person组件服务的reducer
import personReducer from "./reducers/person";

const  allReducers=combineReducers({
    count:countReducer,
    persons:personReducer,
})

// 暴露store
export default createStore(allReducers,composeWithDevTools(applyMiddleware(thunk)))